package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Praise;
import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.TravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> queryForList(QueryObject qo);

    List<Travel> queryForWaitAndRelease(TravelQueryObject qo);

    void updateState(Travel travel);

    List<Travel> queryByStrategyId(TravelQueryObject qo);

    void insertRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    void deleteRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    String selectIsRelation(@Param("travelId") Long travelId, @Param("userId") Long userId, @Param("state") Integer state);

    void insertUserRelation(Praise obj);

    void deleteTravelRelation(@Param("travelId") Long travelId, @Param("userId") Long userId, @Param("state") Integer state);

    Integer selectNumsOfTravelContent(@Param("state") Integer state, @Param("travelId") Long travelId);

    List<Integer> queryTravelIdRows(@Param("authorId") Long authorId, @Param("id") Long id, @Param("state") Integer state);

    void updateAddNums(Long travelId);

    void updateSubNums(Long travelId);

    Integer selectTravelContentNum(Long authorId);

    void updateBrowseNum(Long travelId);

    Integer selectReplyNum(Long id);
}